<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>校园二手交易平台</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body {
            background-color: #f8f9fa;
        }
        .navbar {
            background-color: #4a6fa5;
        }
        .navbar-brand, .nav-link {
            color: white !important;
        }
        .card {
            transition: transform 0.2s;
            margin-bottom: 20px;
        }
        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        }
        .card-img-top {
            height: 200px;
            object-fit: cover;
        }
        .footer {
            background-color: #4a6fa5;
            color: white;
            padding: 20px 0;
            margin-top: 40px;
        }
    </style>
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar navbar-expand-lg navbar-dark">
        <div class="container">
            <a class="navbar-brand" href="/">校园二手交易平台</a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav me-auto">
                    <li class="nav-item">
                        <a class="nav-link {% if request.path == '/' %}active{% endif %}" href="/">首页</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link {% if current_category == '学习用品' %}active{% endif %}" href="/category/学习用品">学习用品</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link {% if current_category == '生活用品' %}active{% endif %}" href="/category/生活用品">生活用品</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="/post">发布物品</a>
                    </li>
                </ul>
                <!-- 搜索框 -->
                <form class="d-flex" action="/search" method="GET">
                    <input class="form-control me-2" type="search" placeholder="搜索商品" name="keyword">
                    <button class="btn btn-light" type="submit">搜索</button>
                </form>
            </div>
        </div>
    </nav>

    <!-- 主内容区 -->
    <div class="container mt-5">
        {% block content %}
        {% endblock %}
    </div>

    <!-- 页脚 -->
    <footer class="footer">
        <div class="container text-center">
            <p>&copy; 2024 校园二手交易平台 - 让闲置物品流动起来</p>
        </div>
    </footer>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>